package com.cloud.encrypting_cloud_storage.enums;

/**
 * @ClassName: ExceptionEnum
 * @Description: 统一状态枚举
 * @author: li
 * @Date: 2022/4/20 11:17 上午
 */
public enum StatusEnum {
    /**
     * 请求成功
     */
    OK(200, "请求成功"),
    /**
     * 请求失败
     */
    BAD_REQUEST(400, "请求数据格式不正确!"),
    UNAUTHORIZED(401, "登录凭证过期!"),
    FORBIDDEN(403, "没有访问权限!"),
    NOT_FOUND(404, "请求的资源找不到!"),
    INTERNAL_SERVER_ERROR(500, "服务器内部错误!"),
    SERVICE_UNAVAILABLE(503, "服务器正忙，请稍后再试!"),
    /**
     * 自定义失败
     */
    UNKNOWN(10000, "未知异常!"),
    NOT_USER(10001,"用户不存在"),
    REGISTERED_USER(10002,"用户名已经存在");

    /**
     * 错误码
     */
    private final Integer code;
    /**
     * 错误描述
     */
    private final String massage;

    StatusEnum(Integer code, String msg) {
        this.code = code;
        this.massage = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMassage() {
        return massage;
    }

}
